#include <iostream>
#include <string>

using namespace std;

void reverseString(string & s, int begin, int end)
{
    int mid = (begin + end) / 2;
    for(int i = begin; i < mid; i++)
    {
        char temp = s[i];
        s[i] = s[end - 1 - i + begin];
        s[end - 1 - i + begin] = temp;
    }
}

int main()
{
    int k;
    string s;
    cin >> k;
    cin >> s;
    reverseString(s, 0, s.size());
    reverseString(s, 0, k);
    reverseString(s, k, s.size());
    cout << s;
}